package com.zgl.message.mail.controller;

import com.zgl.message.mail.entity.MailEntity;
import com.zgl.message.mail.service.SendMailService;
import com.zgl.message.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


@Controller
@RequestMapping("/mail/")
public class EmailController {
    @Autowired
    SendMailService sendMailService;
    @ResponseBody
    @PostMapping("/sendmail")
    public R senMail(@RequestBody MailEntity mailEntity){
       return sendMailService.sendTextMail(mailEntity);
    }
}
